<?php
class Chat extends CI_Controller{
	
	function send(){
	$this->load->model('chat_m','',true);
	$now = date("Y-m-d G:i:s");
	$data = array('message'=>$this->input->post('message'),
					'user_id'=>$this->input->post('user_id'),
					'date_created'=>$now) ;
		$this->chat_m->send($data);
	
	}
	function msg(){
	$id = $this->input->post('user_id');
	$this->load->model('chat_m','',true);
	$data['chat'] = $this->chat_m->msg($id);
	$this->load->view('chat_v',$data);
	}
}
?>